package com.xyzboom.compiler.compiler.grammar

import com.fasterxml.jackson.annotation.JsonTypeInfo
import com.xyzboom.compiler.NoArg

/**
 * Non-terminator
 *
 * @property name
 * @constructor Create empty Non-terminator
 */
@NoArg
class NonTerminator(val name: String) : ISymbol {
    override val isTerminator: Boolean = false
    override fun simpleString(): String = name

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is NonTerminator) return false

        if (name != other.name) return false

        return true
    }

    override fun hashCode(): Int {
        return name.hashCode()
    }

    override fun toString(): String {
        return "NonTerminator($name)"
    }
}